package cn.tedu.recruitmentwebsite.common.controller;

import cn.tedu.recruitmentwebsite.base.response.JsonResult;
import cn.tedu.recruitmentwebsite.common.service.VerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class VerificationController {
    @Autowired
    private VerificationCodeService verificationCodeService;
    @PostMapping("/verifyCode")
    public JsonResult verifyCode(String phoneNumber, String verificationCode) {
        boolean isValid = verificationCodeService.verifyCode(phoneNumber, verificationCode);
        if (isValid) {
            return JsonResult.ok("验证码正确");
        } else {
            return JsonResult.ok("验证码错误");
        }
    }
}

